@extends('admin.public')

@section('content')
    <div class="col-md-12">
        <form data-validate="parsley" method="post">
            {!! csrf_field() !!}
            <section class="panel panel-default">
                <header class="panel-heading">
                    {{ $frame['title'] }}
                    <a href="{{ route('admin.index.admin') }}" class="btn btn-xs btn-default pull-right">管理员列表</a>
                </header>
                <div class="panel-body">
                    <p class="text-muted">所有新添加的管理员都为普通管理员,超级管理员账号只存在一个!</p>
                    <div class="form-group">
                        <label>账号</label>
                        <input type="text" class="form-control parsley-validated" data-required="true" name="name"
                               placeholder="请填写登录用账号">
                    </div>
                    <div class="form-group">
                        <label>邮箱</label>
                        <input type="text" class="form-control parsley-validated" data-type="email" data-required="true" name="email"
                               placeholder="请填写登录用邮箱">
                    </div>
                    <div class="form-group">
                        <label>密码</label>
                        <input type="text" class="form-control parsley-validated" placeholder="请填写登录用密码" name="password"
                               data-required="true">
                    </div>
                    <section class="panel panel-default">
                        <header class="panel-heading bg-light">
                            <ul class="nav nav-tabs nav-justified">
                                <?php $i = 0; ?>
                                @foreach($gaters as $controller => $chunk)
                                    <li class="{{ $i==0? 'active' : ''}}">
                                        <a href="#{{ $controller }}"
                                           data-toggle="tab">{{ config('controller.admin.'.$controller) }}</a>
                                    </li>
                                    <?php $i++; ?>
                                @endforeach
                            </ul>
                        </header>
                        <div class="panel-body">
                            <div class="tab-content">
                                <?php $j = 0; ?>
                                @foreach($gaters as $controller => $chunk)
                                    <div class="tab-pane {{ $j==0? 'active' : ''}}" id="{{ $controller }}">
                                        <div class="checkbox i-checks">
                                            @foreach($chunk as $gater)
                                                <label class="col-md-3">
                                                    <input type="checkbox" name="gater[]"
                                                           value="{{ $gater->id }}"><i></i> {{ $gater->note }}
                                                </label>
                                            @endforeach
                                        </div>
                                    </div>
                                    <?php $j++; ?>
                                @endforeach
                            </div>
                        </div>
                    </section>
                </div>
                <footer class="panel-footer text-right bg-light lter">
                    <button type="submit" class="btn btn-success btn-s-xs">保存</button>
                </footer>
            </section>
        </form>
    </div>
@endsection

@section('js')
@endsection